package service.impl;

import dao.PlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Pl;
import service.PlService;

import java.util.List;

/**
 * 评论表业务逻辑实现类
 */
@Service
public class PlServiceImpl implements PlService {
    @Autowired
    private PlMapper plMapper;

    @Override
    public Pl findPlById(Integer id) {
        return plMapper.findPlById(id);
    }

    @Override
    public List<Pl> findByJjzsId(Integer jjzsId) {
        return plMapper.findByJjzsId(jjzsId);
    }

    @Override
    public List<Pl> findByWzId(Integer wzId) {
        return plMapper.findByWzId(wzId);
    }

    @Override
    public List<Pl> findByYhId(Integer yhId) {
        return plMapper.findByYhId(yhId);
    }

    @Override
    public int add(Pl pl) {
        // 自动填充当前时间
        pl.setCreateTime(java.time.LocalDateTime.now());
        return plMapper.add(pl);
    }

    @Override
    public int update(Pl pl) {
        return plMapper.update(pl);
    }

    @Override
    public int deleteById(Integer id) {
        return plMapper.deleteById(id);
    }

    @Override
    public int deleteByJjzsId(Integer jjzsId) {
        return plMapper.deleteByJjzsId(jjzsId);
    }

    @Override
    public int deleteByWzId(Integer wzId) {
        return plMapper.deleteByWzId(wzId);
    }

    @Override
    public int deleteByYhId(Integer yhId) {
        return plMapper.deleteByYhId(yhId);
    }
}